.class public Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;
.super Ljava/lang/Object;
.source "ExtrasListener.java"

# interfaces
.implements Lcom/google/inject/MembersInjector;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Ljava/lang/Object;",
        "Lcom/google/inject/MembersInjector",
        "<TT;>;"
    }
.end annotation


# instance fields
.field protected a:Ljava/lang/reflect/Field;

.field protected b:Lcom/google/inject/Provider;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/google/inject/Provider",
            "<",
            "Landroid/content/Context;",
            ">;"
        }
    .end annotation
.end field

.field protected c:Lroboguice/inject/InjectExtra;


# direct methods
.method public constructor <init>(Ljava/lang/reflect/Field;Lcom/google/inject/Provider;Lroboguice/inject/InjectExtra;)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/reflect/Field;",
            "Lcom/google/inject/Provider",
            "<",
            "Landroid/content/Context;",
            ">;",
            "Lroboguice/inject/InjectExtra;",
            ")V"
        }
    .end annotation

    .prologue
    .line 65
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 66
    iput-object p1, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->a:Ljava/lang/reflect/Field;

    .line 67
    iput-object p2, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->b:Lcom/google/inject/Provider;

    .line 68
    iput-object p3, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->c:Lroboguice/inject/InjectExtra;

    .line 69
    return-void
.end method


# virtual methods
.method protected a(Ljava/lang/reflect/Field;Ljava/lang/Object;Lcom/google/inject/Injector;)Ljava/lang/Object;
    .locals 4
    .parameter
    .parameter
    .parameter

    .prologue
    .line 134
    if-eqz p2, :cond_0

    invoke-virtual {p1}, Ljava/lang/reflect/Field;->getType()Ljava/lang/Class;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Class;->isPrimitive()Z

    move-result v0

    if-eqz v0, :cond_1

    :cond_0
    move-object v0, p2

    .line 153
    :goto_0
    return-object v0

    .line 141
    :cond_1
    const-class v0, Lroboguice/inject/ExtraConverter;

    const/4 v1, 0x2

    new-array v1, v1, [Ljava/lang/reflect/Type;

    const/4 v2, 0x0

    invoke-virtual {p2}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v3

    aput-object v3, v1, v2

    const/4 v2, 0x1

    invoke-virtual {p1}, Ljava/lang/reflect/Field;->getType()Ljava/lang/Class;

    move-result-object v3

    aput-object v3, v1, v2

    invoke-static {v0, v1}, Lcom/google/inject/util/Types;->newParameterizedType(Ljava/lang/reflect/Type;[Ljava/lang/reflect/Type;)Ljava/lang/reflect/ParameterizedType;

    move-result-object v0

    .line 142
    invoke-static {v0}, Lcom/google/inject/Key;->get(Ljava/lang/reflect/Type;)Lcom/google/inject/Key;

    move-result-object v0

    .line 146
    invoke-interface {p3}, Lcom/google/inject/Injector;->getBindings()Ljava/util/Map;

    move-result-object v1

    .line 148
    invoke-interface {v1, v0}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_2

    .line 149
    invoke-interface {p3, v0}, Lcom/google/inject/Injector;->getInstance(Lcom/google/inject/Key;)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lroboguice/inject/ExtraConverter;

    .line 150
    invoke-interface {p0, p2}, Lroboguice/inject/ExtraConverter;->a(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    goto :goto_0

    :cond_2
    move-object v0, p2

    goto :goto_0
.end method

.method public injectMembers(Ljava/lang/Object;)V
    .locals 10
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .prologue
    const/4 v9, 0x3

    const/4 v8, 0x2

    const/4 v7, 0x0

    const/4 v6, 0x1

    .line 72
    iget-object v1, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->b:Lcom/google/inject/Provider;

    invoke-interface {v1}, Lcom/google/inject/Provider;->get()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/content/Context;

    .line 74
    instance-of v2, v1, Landroid/app/Activity;

    if-nez v2, :cond_1

    .line 128
    :cond_0
    :goto_0
    return-void

    .line 78
    :cond_1
    move-object v0, v1

    check-cast v0, Landroid/app/Activity;

    move-object v2, v0

    .line 81
    iget-object v3, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->c:Lroboguice/inject/InjectExtra;

    invoke-interface {v3}, Lroboguice/inject/InjectExtra;->value()Ljava/lang/String;

    move-result-object v3

    .line 82
    invoke-virtual {v2}, Landroid/app/Activity;->getIntent()Landroid/content/Intent;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v2

    .line 84
    if-eqz v2, :cond_2

    invoke-virtual {v2, v3}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z

    move-result v4

    if-nez v4, :cond_3

    .line 87
    :cond_2
    iget-object v1, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->c:Lroboguice/inject/InjectExtra;

    invoke-interface {v1}, Lroboguice/inject/InjectExtra;->a()Z

    move-result v1

    if-nez v1, :cond_0

    .line 90
    new-instance v1, Ljava/lang/IllegalStateException;

    const-string v2, "Can\'t find the mandatory extra identified by key [%s] on field %s.%s"

    new-array v4, v9, [Ljava/lang/Object;

    aput-object v3, v4, v7

    iget-object v3, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->a:Ljava/lang/reflect/Field;

    invoke-virtual {v3}, Ljava/lang/reflect/Field;->getDeclaringClass()Ljava/lang/Class;

    move-result-object v3

    aput-object v3, v4, v6

    iget-object v3, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->a:Ljava/lang/reflect/Field;

    invoke-virtual {v3}, Ljava/lang/reflect/Field;->getName()Ljava/lang/String;

    move-result-object v3

    aput-object v3, v4, v8

    invoke-static {v2, v4}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v1

    .line 95
    :cond_3
    invoke-virtual {v2, v3}, Landroid/os/Bundle;->get(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    .line 98
    instance-of v3, v1, Lroboguice/inject/InjectorProvider;

    if-eqz v3, :cond_6

    .line 99
    check-cast v1, Lroboguice/inject/InjectorProvider;

    invoke-interface {v1}, Lroboguice/inject/InjectorProvider;->a()Lcom/google/inject/Injector;

    move-result-object v1

    .line 100
    iget-object v3, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->a:Ljava/lang/reflect/Field;

    invoke-virtual {p0, v3, v2, v1}, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->a(Ljava/lang/reflect/Field;Ljava/lang/Object;Lcom/google/inject/Injector;)Ljava/lang/Object;

    move-result-object v1

    .line 111
    :goto_1
    if-nez v1, :cond_4

    iget-object v2, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->a:Ljava/lang/reflect/Field;

    const-class v3, Lcom/google/inject/internal/Nullable;

    invoke-virtual {v2, v3}, Ljava/lang/reflect/Field;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;

    move-result-object v2

    if-nez v2, :cond_4

    .line 112
    new-instance v1, Ljava/lang/NullPointerException;

    const-string v2, "Can\'t inject null value into %s.%s when field is not @Nullable"

    new-array v3, v8, [Ljava/lang/Object;

    iget-object v4, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->a:Ljava/lang/reflect/Field;

    invoke-virtual {v4}, Ljava/lang/reflect/Field;->getDeclaringClass()Ljava/lang/Class;

    move-result-object v4

    aput-object v4, v3, v7

    iget-object v4, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->a:Ljava/lang/reflect/Field;

    invoke-virtual {v4}, Ljava/lang/reflect/Field;->getName()Ljava/lang/String;

    move-result-object v4

    aput-object v4, v3, v6

    invoke-static {v2, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V

    throw v1

    .line 116
    :cond_4
    iget-object v2, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->a:Ljava/lang/reflect/Field;

    invoke-virtual {v2, v6}, Ljava/lang/reflect/Field;->setAccessible(Z)V

    .line 119
    :try_start_0
    iget-object v2, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->a:Ljava/lang/reflect/Field;

    invoke-virtual {v2, p1, v1}, Ljava/lang/reflect/Field;->set(Ljava/lang/Object;Ljava/lang/Object;)V
    :try_end_0
    .catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_1

    goto/16 :goto_0

    .line 121
    :catch_0
    move-exception v1

    .line 122
    new-instance v2, Ljava/lang/RuntimeException;

    invoke-direct {v2, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/Throwable;)V

    throw v2

    .line 124
    :catch_1
    move-exception v2

    .line 125
    new-instance v2, Ljava/lang/IllegalArgumentException;

    const-string v3, "Can\'t assign %s value %s to %s field %s"

    const/4 v4, 0x4

    new-array v4, v4, [Ljava/lang/Object;

    if-eqz v1, :cond_5

    invoke-virtual {v1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v5

    :goto_2
    aput-object v5, v4, v7

    aput-object v1, v4, v6

    iget-object v1, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->a:Ljava/lang/reflect/Field;

    invoke-virtual {v1}, Ljava/lang/reflect/Field;->getType()Ljava/lang/Class;

    move-result-object v1

    aput-object v1, v4, v8

    iget-object v1, p0, Lroboguice/inject/ExtrasListener$ExtrasMembersInjector;->a:Ljava/lang/reflect/Field;

    invoke-virtual {v1}, Ljava/lang/reflect/Field;->getName()Ljava/lang/String;

    move-result-object v1

    aput-object v1, v4, v9

    invoke-static {v3, v4}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v2, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v2

    :cond_5
    const-string v5, "(null)"

    goto :goto_2

    :cond_6
    move-object v1, v2

    goto :goto_1
.end method
